home *** CD-ROM | disk | FTP | other *** search
- *
- * window.asm -- Asm example that calls the EGS functions
- *
- * $
- * $ FILE : E_G_S:Wartung&Pflege/A-Include/egs/window.asm
- * $ VERSION : 1
- * $ REVISION : 21
- * $ DATE : 05-Mar-93 19:03
- * $
- * $ Author : mvk
- * $
- *
- * This programm is opens a EI_Window with
- * an rectangle in it.
- * It's only to show that the ASM-Stuff works
- *
- *
- * (c) Copyright 1990/93 VIONA Development
- * All Rights Reserved
- *
- *
-
- INCLUDE "exec/types.i"
- INCLUDE "exec/macros.i"
- INCLUDE "exec/libraries.i"
- INCLUDE "exec/nodes.i"
- INCLUDE "exec/ports.i"
-
- INCLUDE "egs/all.i"
-
- XDEF _main
-
- XREF _printf
- XREF _AbsExecBase
-
-
- EXTERN_LIB OpenLibrary
- EXTERN_LIB CloseLibrary
- EXTERN_LIB GetMsg
- EXTERN_LIB WaitPort
- EXTERN_LIB ReplyMsg
-
-
- STRUCTURE my_libs,0
- APTR my_egsgfx
- APTR my_egsintui
- APTR my_win
- APTR my_rast
- APTR my_port
- APTR my_msg
- LABEL my_SIZE
-
- section code
-
-
- _main:
- ;------ open the test library: this will bring it in from disk
-
- move.l _AbsExecBase,a6
- lea -my_SIZE(a7),a7 ;Sturcture Memory
- move.l a7,a5
- move.l a7,myptr
-
- lea egsintuiName(pc),a1
- moveq #0,d0
- CALLLIB _LVOOpenLibrary
- move.l d0,my_egsintui(a5)
-
- tst.l d0
- bne.s 1$
-
- ;------ couldn't find the library
-
- pea egsintuiName(pc)
- pea nolibmsg(pc)
- jsr _printf
- addq #8,sp
-
- bra main_end
- 1$:
- lea egsgfxName(pc),a1
- moveq #0,d0
- CALLLIB _LVOOpenLibrary
- move.l d0,my_egsgfx(a5)
-
- tst.l d0
- bne.s 2$
-
- ;------ couldn't find the library
-
- pea egsgfxName(pc)
- pea nolibmsg(pc)
- jsr _printf
- addq #8,sp
-
- bra main_end1
- 2$:
- pea egsintuiName(pc)
- pea Msg1(pc)
- jsr _printf
- addq #8,sp ;fix 2 long stack pushes
-
- pea egsgfxName(pc)
- pea Msg1(pc)
- jsr _printf
- addq #8,sp ;fix 2 long stack pushes
-
- ;------ print the library name, version, and revision
-
- moveq #0,d0
-
- pea Msg2(pc)
- jsr _printf
- addq #4,sp ;fix 1 long stack pushes
-
- ;------ call the first test function
-
- lea mywin,a0
-
- LINKLIB _LVOEI_OpenWindow,my_egsintui(a5)
-
- tst.l d0
- bne 3$
-
- pea Msg4(pc)
- jsr _printf
- addq #4,sp ;fix 1 long stack pushes
-
- bra ende
- 3$:
- move.l d0,my_win(a5)
- move.l d0,a0
- move.l eiwi_UserPort(a0),my_port(a5)
- move.l eiwi_RPort(a0),my_rast(a5)
-
- move.l my_rast(a5),a0
- move.l #$FF000000,d0 ;red
- LINKLIB _LVOEG_SetAPen,my_egsgfx(a5)
-
- move.l my_rast(a5),a0
- move.w #50,d0
- move.w #50,d1
- move.w #100,d2
- move.w #100,d3
- moveq #0,d5
-
- LINKLIB _LVOEG_RectFill,my_egsgfx(a5)
-
- loop:
- move.l my_port(a5),a0
- CALLLIB _LVOWaitPort
- move.l my_port(a5),a0
- CALLLIB _LVOGetMsg
- move.l d0,my_msg(a5)
- move.l d0,a1
- CALLLIB _LVOReplyMsg
-
- move.l my_msg(a5),a1
- move.l eims_Class(a1),d0
- cmp.l #EI_iCLOSEWINDOW,d0
- bne loop
-
- pea Msg5(pc)
- jsr _printf
- addq #4,sp ;fix 1 long stack pushes
-
- move.l myptr,a5
- move.l my_win(a5),a0
- LINKLIB _LVOEI_CloseWindow,my_egsintui(a5)
-
- ende:
- move.l myptr,a5
- ;------ close the egsgfx.library
- move.l _AbsExecBase,a6
- move.l my_egsgfx(a5),a1
- CALLLIB _LVOCloseLibrary
-
- main_end:
- move.l myptr,a5
- ;------ close the egsintui.library
- move.l _AbsExecBase,a6
- move.l my_egsintui(a5),a1
- CALLLIB _LVOCloseLibrary
-
- main_end1:
- lea my_SIZE(a7),a7
- moveq #0,d0
- rts
-
- myptr: dc.l 0
-
- mywin: dc.w 100
- dc.w 100
- dc.w 350
- dc.w 350
- dc.w 200
- dc.w 200
- dc.w 3000
- dc.w 3000
- dc.l 0
- dc.l EI_WINDOWSIZE!EI_WINDOWCLOSE!EI_WINDOWBACK!EI_WINDOWDRAG
- dc.l 0
- dc.l name
- dc.l 0
- dc.l EI_iCLOSEWINDOW
- dc.l 0
- color:
- dc.l 0 ;1
- dc.l 0 ;2
- dc.l 0 ;3
- dc.l 0 ;4
- dc.l 0 ;5
- dc.l 0 ;6
- dc.l 0 ;8
- dc.l 0 ;Menu
- dc.l 0 ; Render
-
- name: dc.b 'Winddow',0
- egsgfxName: dc.b 'egsgfx.library',0
- egsintuiName: dc.b 'egsintui.library',0
- nolibmsg: dc.b 'Can not open library "%s"',10,0
- Msg1: dc.b 'Open library "%s"',10,0
- Msg2: dc.b 'Call EI_OpenWindw',10,0
- Msg4: dc.b 'Cant Open Window',10,0
- Msg5: dc.b 'Call EI_CloseWindow',10,0
- cnop 4,0
- END
-
-
-
-